export default function params(url: string, obj: {}) {
  let result = '';
  let item;
  if (url.includes('?')) {
    for (item in obj) {
      if (obj[item] && String(obj[item])) {
        result += `&${item}=${obj[item]}`;
      }
    }
  } else {
    result += '?';
    for (item in obj) {
      if (obj[item] && String(obj[item])) {
        result += `&${item}=${obj[item]}`;
      }
    }
  }
  return url + result;
}
